home *** CD-ROM | disk | FTP | other *** search
/ Delphi Magazine Collection 2001 / Delphi Magazine Collection 20001 (2001).iso / DISKS / Issue63 / Docking / MultipleClientsU.pas < prev   
Encoding:
Pascal/Delphi Source File  |  2000-09-27  |  882 b   |  46 lines

  1. unit MultipleClientsU;
  2.  
  3. interface
  4.  
  5. uses
  6.   Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs;
  7.  
  8. type
  9.   TMainForm = class(TForm)
  10.     procedure FormCreate(Sender: TObject);
  11.   private
  12.     { Private declarations }
  13.   public
  14.     { Public declarations }
  15.   end;
  16.  
  17. var
  18.   MainForm: TMainForm;
  19.  
  20. implementation
  21.  
  22. {$R *.DFM}
  23.  
  24. procedure TMainForm.FormCreate(Sender: TObject);
  25. const
  26.   Colors: array[1..6] of TColor =
  27.     (clWhite, clBlack, clBlue, clGreen, clRed, clYellow);
  28. var
  29.   I: Integer;
  30. begin
  31.   for I := Low(Colors) to High(Colors) do
  32.     with TForm.CreateNew(Self) do
  33.     begin
  34.       Caption := 'Dock me in the main form';
  35.       Color := Colors[I];
  36.       DragKind := dkDock;
  37.       DragMode := dmAutomatic;
  38.       Position := poDefaultPosOnly;
  39.       Width := 230;
  40.       Height := 100;
  41.       Visible := True;
  42.     end;
  43. end;
  44.  
  45. end.
  46.